package com.tzz.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class RandomUtil {
    static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String getPresaleId() {
        return "activity" + dateFormat.format(new Date(System.currentTimeMillis())).replace("-", "").replace(" ", "").replace(":", "");
    }

    public static String getOrderId() {
        return "ordertest" + dateFormat.format(new Date(System.currentTimeMillis())).replace("-", "").replace(" ", "").replace(":", "");
    }

    public static String getDoOrderId() {
        return "doordertest" + dateFormat.format(new Date(System.currentTimeMillis())).replace("-", "").replace(" ", "").replace(":", "");
    }

    public static String getKeyAccountOrderId() {
        return "dkh" + dateFormat.format(new Date(System.currentTimeMillis())).replace("-", "").replace(" ", "").replace(":", "");
    }

    public static String getRandomId(String preString){
        return preString+dateFormat.format(new Date(System.currentTimeMillis())).replace("-", "").replace(" ", "").replace(":", "");
    }


}
